<template>
	<view class="mainpadding2">
		<view class="ffffff radius mainpadding margin_top" v-for="item in list.data" :key="item.id"
			@click="jumpdetail('/pages/qinglaishuo/shijiangxq?id=',item.id)">
			<view class="flexbetween xiahuaxian">
				<view class="titletext fonweight xiaohei">需求类别:<text
						class="lable">{{item.type==1?'诉求':'建议'}}</text>
				</view>
				<view class="xiaocheng ershil" v-if="item.status==1">处理中</view>
				<view class="xiaolv ershil" v-if="item.status==2">已处理</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="titletext fonweight xiaohei">{{item.fwtype.name}}</view>
				<view class="ershil xiaohei flexright">{{item.createtime_text}}</view>
			</view>
			<view class="ershiba fonweight xiaohei margin_top">{{item.title}}</view>
			<view class="ershiba xiaohei margin_top">{{item.des}}</view>
			<view class="flexleft flex_wrap">
				<view class="flexcenter ershiw margin_top" v-for="(ite,inde) in item.images_text" :key="inde"
					>
					<image style="width: 150rpx;height: 152rpx;" :src="ite" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				httpRequest.request("/api/user/getSjList", 'GET', {
					page: page || 1,
					limit: this.limit
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = this.list;
						if (isPage == true) {
							this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							this.list.data = resList.data;
						}
					}
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			}
		}
	}
</script>

<style>

</style>